<?php

namespace app\common\validate;

use think\Validate;

class Shop extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'shop_name'       => 'require',
        'mobile'          => 'require|/^1[3456789]\d{9}$/',
        'consignor'       => 'require',
        'area_id'         => 'require|min:6|max:12|/^[0-9a-zA-Z_]{1,}$/',
        'wanwan_id'       => 'require',
        'details_address' => 'require',
        'shop_type'       => 'require',
        'shop_cat'        => 'require',
        'shop_url'        => 'require',
        'shop_pic'        => 'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'mobile.require'          => '手机号码不能为空',
        'mobile'                  => '手机号码格式错误',
        'shop_name.require'       => '店铺名称不能为空',
        'consignor.require'       => '发货人不能为空',
        'area_id.require'         => '地区不能为空',
        'wanwan_id.require'       => '旺旺号不能为空',
        'details_address.require' => '详细地址不能为空',
        'shop_type.require'       => '店铺类型不能为空',
        'shop_cat.require'        => '店铺类目不能为空',
        'shop_url.require'        => '店铺链接不能为空',
        'shop_pic.require'        => '店铺截图不能为看空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];

}
